package sxe.core.math;

import snobject.snDouble;
import snobject.snObject;
import snobject.snObjectArgList;
import step.FunctionWrapper;
import step.EvaluationFailure;

/**
 * Returns the arc cosine of an angle, in the range of 0.0 through pi.
 * @param argv must contain an snDouble object at top of the stack
 * @return returns the arc cosine of the argument
 */

public class acos extends FunctionWrapper{
	
	public snObject Call(snObjectArgList argv) throws EvaluationFailure{
		// REQUIRES: argv must contain an snDouble object at top of the stack
		// EFFECTS: returns the snDouble of the arc cosine of the value from argv
		double ret = argv.popDouble().getDbl();
		
		return new snDouble(Math.acos(ret));
	}
}